package great.project.bean.supplier;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.function.Supplier;

public class Main {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext();
        annotationConfigApplicationContext.registerBean(Human.class, new Supplier<Human>() {
            @Override
            public Human get() {
                return new Human("human-zhangSan");
            }
        });

        annotationConfigApplicationContext.refresh();
        final Human human = annotationConfigApplicationContext.getBean("human", Human.class);

        System.out.println(human);

    }


}
